import config from '@/utils/config';
import { MockMethod } from 'vite-plugin-mock';

// 问题列表
const getQuestionList = {
  url: config.url.question_list,
  method: 'get',
  response: () => {
    return {
      code: 200,
      data: {
        guess: [
          { id: 11, title: '如何催单', content: '', children: null },
          { id: 12, title: '什么时候能收到商品', content: '', children: null },
          { id: 13, title: '优惠券怎么用不了', content: '', children: null },
        ],
        common: [
          { id: 1, title: '商品类问题', content: '', children: null },
          { id: 2, title: '订单类问题', content: '', children: null },
          { id: 3, title: '配送类问题', content: '', children: null },
          { id: 4, title: '账户类问题', content: '', children: null },
          { id: 5, title: '优惠活动类问题', content: '', children: null },
          { id: 6, title: '支付与退款类问题', content: '', children: null },
          { id: 7, title: '售后类问题', content: '', children: null },
        ],
      },
      message: 'success',
    };
  },
};

// 详细问题
const getQuestionDetail = {
  url: config.url.question_detail,
  method: 'post',
  response: () => {
    return {
      code: 200,
      data: {
        id: 2,
        title: '订单类问题',
        content: '',
        children: [
          {
            id: 21,
            title: '订单已经提交成功，能否修改？',
            content:
              '您好！订单发货前您可以联系在线客服进行修改，发货后订单将无法修改，建议您取消订单重新订购。',
            children: null,
          },
          {
            id: 22,
            title: '我怎么知道我的订单的实际的状态？',
            content: '您好！您可以通过移动端“我的”查询订单实际的状态或者通过在线客服进行查询。',
            children: null,
          },
          {
            id: 23,
            title: '订单已经提交成功，能否修改？',
            content:
              '您好！订单发货前您可以联系在线客服进行修改，发货后订单将无法修改，建议您取消订单重新订购。',
            children: null,
          },
          {
            id: 24,
            title: '我怎么知道我的订单的实际的状态？',
            content: '您好！您可以通过移动端“我的”查询订单实际的状态或者通过在线客服进行查询。',
            children: null,
          },
          {
            id: 25,
            title: '订单已经提交成功，能否修改？',
            content:
              '您好！订单发货前您可以联系在线客服进行修改，发货后订单将无法修改，建议您取消订单重新订购。',
            children: null,
          },
        ],
      },
      message: 'success',
    };
  },
};

export default [getQuestionList, getQuestionDetail] as MockMethod[];
